/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dieci.managers.returnmanager;

import dieci.database.returns.ReturnHibernateDAO;
import dieci.system.Order;
import dieci.system.Return;
import java.util.Date;
import java.util.List;

/**
 *
 * @author Blanco
 */
public class ReturnManager {
    public ReturnManager()
    {
        this.returnDAO = new ReturnHibernateDAO();
    }

    public void saveReturn(Return returnOb)
    {
        //call prod dao to save the return in db
        returnDAO.saveOrUpdate(returnOb);        
    }

    
    public void deleteReturn(Return returnOb)
    {
        returnDAO.delete(returnOb);
    }

    public Return find(long returnId)
    {
        return returnDAO.findByReturnId(returnId);
    }
    
    public List<Return> list()
    {
        return returnDAO.list();
    }
    
    public List<Return> findByDateRange(Date from, Date end)
    {
        return returnDAO.findByReturnDateRange(from,end);
    }
    
    public List<Return> findBySupplier(String supplierName)
    {
        return returnDAO.findBySupplierName(supplierName);
    }
     
    public List<Return> findByOrder(Order order)
    {
        return returnDAO.findByOrder(order);
    }
    private ReturnHibernateDAO returnDAO;
    
}
